<%-- 
    Document   : index
    Created on : Sep 8, 2013, 2:29:59 AM
    Author     : Administrator
--%>

<%@page import="Model.Pojo.Loainhanvien"%>
<%@page import="Model.Dao.DAOLoaiNhanVien"%>
<%@page import="Controler.CXuLy"%>
<%@page import="Model.Pojo.Nhanvien"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<head>
    <meta charset="utf-8" />
    <title><%
        if (request.getAttribute("TIM_KIEM_NHAN_VIEN") != null)
        {
            out.
                    print(
                    "Tìm kiếm nhân viên");
        }
        else
        {
            out.
                    print(
                    "Danh sách nhân viên");
        }
        %></title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="Mosaddek" name="author" />
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="assets/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" />
    <link href="assets/bootstrap/css/bootstrap-fileupload.css" rel="stylesheet" />
    <link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
    <link href="css/style-responsive.css" rel="stylesheet" />
    <link href="css/style-default.css" rel="stylesheet" id="style_color" />
    <link rel="stylesheet" type="text/css" href="assets/uniform/css/uniform.default.css" />
    <link rel="stylesheet" href="assets/data-tables/DT_bootstrap.css" />
    <link href="assets/fancybox/source/jquery.fancybox.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="assets/uniform/css/uniform.default.css" />

    <link rel="stylesheet" type="text/css" href="assets/chosen-bootstrap/chosen/chosen.css" />
    <link rel="stylesheet" type="text/css" href="assets/jquery-tags-input/jquery.tagsinput.css" />
    <link rel="stylesheet" type="text/css" href="assets/clockface/css/clockface.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-wysihtml5/bootstrap-wysihtml5.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-datepicker/css/datepicker.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-timepicker/compiled/timepicker.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-colorpicker/css/colorpicker.css" />
    <link rel="stylesheet" href="assets/bootstrap-toggle-buttons/static/stylesheets/bootstrap-toggle-buttons.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-daterangepicker/daterangepicker.css" />
</head>
<body class="fixed-top">
    <jsp:include page="User Control/banner.jsp" flush="true"></jsp:include>

        <div id="container" class="row-fluid">
        <jsp:include page="User Control/menu.jsp" flush="true"></jsp:include>
            <div id="main-content">
                <div class="container-fluid">
                <jsp:include page="User Control/title.jsp" flush="true"></jsp:include>
                    <div class="row-fluid">
                        <div class="span12">
                            <!-- BEGIN EXAMPLE TABLE widget-->
                            <div class="widget">
                                <div class="widget-title">
                                    <h4><i class="icon-search"></i> Tìm kiếm</h4>
                                    <span class="tools">
                                        <a href="javascript:;"   class="icon-chevron-up"></a>
                                        <a href="javascript:;" class="icon-remove"></a>
                                    </span>
                                </div>
                            <%
                                if (request.getAttribute("TIM_KIEM_NHAN_VIEN") != null)
                                {
                                    out.print("<div class=\"widget-body\">");
                                }
                                else
                                {
                                    out.
                                            print(
                                            "<div class=\"widget-body\" style=\"display: none;\">");
                                }
                            %>

                            <form action="tim-kiem-nhan-vien.htm" method="post" class="form-horizontal">
                                <div class="control-group">
                                    <label class="control-label">Chức vụ</label>
                                    <div class="controls">
                                        <select name="ddlLoaiNV" style="width: 500px" class="span6 chzn-select" data-placeholder="Chọn ..." tabindex="1" required>
                                            <%
                                                List<Loainhanvien> dsLoaiNV = (new DAOLoaiNhanVien()).
                                                        DanhSachLoaiNhanVien();
                                                for (Loainhanvien loaiNV : dsLoaiNV)
                                                {%>
                                            <option  value =
                                                     "<%=loaiNV.getId()%>"><%=loaiNV.getTenloai()%></option>
                                            <%}%>
                                        </select>
                                    </div>
                                </div>
                                <div class="control-group" >
                                    <label class="control-label">Mã nhân viên</label>
                                    <div class="controls" >
                                        <input type="text" name="manhanvien" class="span6 " style="margin: 0 auto;width: 100%" data-provide="typeahead" data-items="4" data-source="[&quot;Alabama&quot;,&quot;Alaska&quot;,&quot;Arizona&quot;,&quot;Arkansas&quot;,&quot;California&quot;,&quot;Colorado&quot;,&quot;Connecticut&quot;,&quot;Delaware&quot;,&quot;Florida&quot;,&quot;Georgia&quot;,&quot;Hawaii&quot;,&quot;Idaho&quot;,&quot;Illinois&quot;,&quot;Indiana&quot;,&quot;Iowa&quot;,&quot;Kansas&quot;,&quot;Kentucky&quot;,&quot;Louisiana&quot;,&quot;Maine&quot;,&quot;Maryland&quot;,&quot;Massachusetts&quot;,&quot;Michigan&quot;,&quot;Minnesota&quot;,&quot;Mississippi&quot;,&quot;Missouri&quot;,&quot;Montana&quot;,&quot;Nebraska&quot;,&quot;Nevada&quot;,&quot;New Hampshire&quot;,&quot;New Jersey&quot;,&quot;New Mexico&quot;,&quot;New York&quot;,&quot;North Dakota&quot;,&quot;North Carolina&quot;,&quot;Ohio&quot;,&quot;Oklahoma&quot;,&quot;Oregon&quot;,&quot;Pennsylvania&quot;,&quot;Rhode Island&quot;,&quot;South Carolina&quot;,&quot;South Dakota&quot;,&quot;Tennessee&quot;,&quot;Texas&quot;,&quot;Utah&quot;,&quot;Vermont&quot;,&quot;Virginia&quot;,&quot;Washington&quot;,&quot;West Virginia&quot;,&quot;Wisconsin&quot;,&quot;Wyoming&quot;]" />
                                    </div>
                                </div>
                                <div class="control-group" >
                                    <label class="control-label">Tên nhân viên</label>
                                    <div class="controls" >
                                        <input type="text" name="tennhanvien" class="span6 " style="margin: 0 auto;width: 100%" data-provide="typeahead" data-items="4" data-source="[&quot;Alabama&quot;,&quot;Alaska&quot;,&quot;Arizona&quot;,&quot;Arkansas&quot;,&quot;California&quot;,&quot;Colorado&quot;,&quot;Connecticut&quot;,&quot;Delaware&quot;,&quot;Florida&quot;,&quot;Georgia&quot;,&quot;Hawaii&quot;,&quot;Idaho&quot;,&quot;Illinois&quot;,&quot;Indiana&quot;,&quot;Iowa&quot;,&quot;Kansas&quot;,&quot;Kentucky&quot;,&quot;Louisiana&quot;,&quot;Maine&quot;,&quot;Maryland&quot;,&quot;Massachusetts&quot;,&quot;Michigan&quot;,&quot;Minnesota&quot;,&quot;Mississippi&quot;,&quot;Missouri&quot;,&quot;Montana&quot;,&quot;Nebraska&quot;,&quot;Nevada&quot;,&quot;New Hampshire&quot;,&quot;New Jersey&quot;,&quot;New Mexico&quot;,&quot;New York&quot;,&quot;North Dakota&quot;,&quot;North Carolina&quot;,&quot;Ohio&quot;,&quot;Oklahoma&quot;,&quot;Oregon&quot;,&quot;Pennsylvania&quot;,&quot;Rhode Island&quot;,&quot;South Carolina&quot;,&quot;South Dakota&quot;,&quot;Tennessee&quot;,&quot;Texas&quot;,&quot;Utah&quot;,&quot;Vermont&quot;,&quot;Virginia&quot;,&quot;Washington&quot;,&quot;West Virginia&quot;,&quot;Wisconsin&quot;,&quot;Wyoming&quot;]" />
                                    </div>
                                </div>
                                <div class="control-group" >
                                    <label class="control-label">Địa chỉ</label>
                                    <div class="controls" >
                                        <input type="text" name="diachi" class="span6 " style="margin: 0 auto;width: 100%" data-provide="typeahead" data-items="4" data-source="[&quot;Alabama&quot;,&quot;Alaska&quot;,&quot;Arizona&quot;,&quot;Arkansas&quot;,&quot;California&quot;,&quot;Colorado&quot;,&quot;Connecticut&quot;,&quot;Delaware&quot;,&quot;Florida&quot;,&quot;Georgia&quot;,&quot;Hawaii&quot;,&quot;Idaho&quot;,&quot;Illinois&quot;,&quot;Indiana&quot;,&quot;Iowa&quot;,&quot;Kansas&quot;,&quot;Kentucky&quot;,&quot;Louisiana&quot;,&quot;Maine&quot;,&quot;Maryland&quot;,&quot;Massachusetts&quot;,&quot;Michigan&quot;,&quot;Minnesota&quot;,&quot;Mississippi&quot;,&quot;Missouri&quot;,&quot;Montana&quot;,&quot;Nebraska&quot;,&quot;Nevada&quot;,&quot;New Hampshire&quot;,&quot;New Jersey&quot;,&quot;New Mexico&quot;,&quot;New York&quot;,&quot;North Dakota&quot;,&quot;North Carolina&quot;,&quot;Ohio&quot;,&quot;Oklahoma&quot;,&quot;Oregon&quot;,&quot;Pennsylvania&quot;,&quot;Rhode Island&quot;,&quot;South Carolina&quot;,&quot;South Dakota&quot;,&quot;Tennessee&quot;,&quot;Texas&quot;,&quot;Utah&quot;,&quot;Vermont&quot;,&quot;Virginia&quot;,&quot;Washington&quot;,&quot;West Virginia&quot;,&quot;Wisconsin&quot;,&quot;Wyoming&quot;]" />
                                    </div>
                                </div>
                                <div class="control-group" >
                                    <label class="control-label">Điện thoại</label>
                                    <div class="controls" >
                                        <input type="text" name="dienthoai" class="span6 " style="margin: 0 auto;width: 100%" data-provide="typeahead" data-items="4" data-source="[&quot;Alabama&quot;,&quot;Alaska&quot;,&quot;Arizona&quot;,&quot;Arkansas&quot;,&quot;California&quot;,&quot;Colorado&quot;,&quot;Connecticut&quot;,&quot;Delaware&quot;,&quot;Florida&quot;,&quot;Georgia&quot;,&quot;Hawaii&quot;,&quot;Idaho&quot;,&quot;Illinois&quot;,&quot;Indiana&quot;,&quot;Iowa&quot;,&quot;Kansas&quot;,&quot;Kentucky&quot;,&quot;Louisiana&quot;,&quot;Maine&quot;,&quot;Maryland&quot;,&quot;Massachusetts&quot;,&quot;Michigan&quot;,&quot;Minnesota&quot;,&quot;Mississippi&quot;,&quot;Missouri&quot;,&quot;Montana&quot;,&quot;Nebraska&quot;,&quot;Nevada&quot;,&quot;New Hampshire&quot;,&quot;New Jersey&quot;,&quot;New Mexico&quot;,&quot;New York&quot;,&quot;North Dakota&quot;,&quot;North Carolina&quot;,&quot;Ohio&quot;,&quot;Oklahoma&quot;,&quot;Oregon&quot;,&quot;Pennsylvania&quot;,&quot;Rhode Island&quot;,&quot;South Carolina&quot;,&quot;South Dakota&quot;,&quot;Tennessee&quot;,&quot;Texas&quot;,&quot;Utah&quot;,&quot;Vermont&quot;,&quot;Virginia&quot;,&quot;Washington&quot;,&quot;West Virginia&quot;,&quot;Wisconsin&quot;,&quot;Wyoming&quot;]" />
                                    </div>
                                </div>
                                <div class="control-group" >
                                    <label class="control-label">Email</label>
                                    <div class="controls" >
                                        <input type="text" name="email" class="span6 " style="margin: 0 auto;width: 100%" data-provide="typeahead" data-items="4" data-source="[&quot;Alabama&quot;,&quot;Alaska&quot;,&quot;Arizona&quot;,&quot;Arkansas&quot;,&quot;California&quot;,&quot;Colorado&quot;,&quot;Connecticut&quot;,&quot;Delaware&quot;,&quot;Florida&quot;,&quot;Georgia&quot;,&quot;Hawaii&quot;,&quot;Idaho&quot;,&quot;Illinois&quot;,&quot;Indiana&quot;,&quot;Iowa&quot;,&quot;Kansas&quot;,&quot;Kentucky&quot;,&quot;Louisiana&quot;,&quot;Maine&quot;,&quot;Maryland&quot;,&quot;Massachusetts&quot;,&quot;Michigan&quot;,&quot;Minnesota&quot;,&quot;Mississippi&quot;,&quot;Missouri&quot;,&quot;Montana&quot;,&quot;Nebraska&quot;,&quot;Nevada&quot;,&quot;New Hampshire&quot;,&quot;New Jersey&quot;,&quot;New Mexico&quot;,&quot;New York&quot;,&quot;North Dakota&quot;,&quot;North Carolina&quot;,&quot;Ohio&quot;,&quot;Oklahoma&quot;,&quot;Oregon&quot;,&quot;Pennsylvania&quot;,&quot;Rhode Island&quot;,&quot;South Carolina&quot;,&quot;South Dakota&quot;,&quot;Tennessee&quot;,&quot;Texas&quot;,&quot;Utah&quot;,&quot;Vermont&quot;,&quot;Virginia&quot;,&quot;Washington&quot;,&quot;West Virginia&quot;,&quot;Wisconsin&quot;,&quot;Wyoming&quot;]" />
                                    </div>
                                </div>
                                <div style="text-align: center">
                                    <button class="btn btn-large" type="submit"><i class="icon-eye-open"></i> Tìm kiếm</button></div>
                            </form>
                        </div>
                    </div>
                </div>  
                <%
                    List<Nhanvien> list = (List<Nhanvien>) request.
                            getAttribute("dsNhanVien");
                    if (list != null)
                    {

                %>
                <div class="row-fluid">
                    <div class="span12">
                        <!-- BEGIN EXAMPLE TABLE widget-->
                        <div class="widget purple">
                            <div class="widget-title">
                                <h4><i class="icon-reorder"></i>  <%
                                    if (request.getAttribute("TIM_KIEM_NHAN_VIEN") != null)
                                    {
                                        out.
                                                print(
                                                "Kết quả tìm được - " + list.size() + " nhân viên");
                                    }
                                    else
                                    {
                                        out.
                                                print(
                                                "Danh sách nhân viên");
                                    }
                                    %></h4>
                                <span class="tools">
                                    <a href="javascript:;" class="icon-chevron-down"></a>
                                    <a href="javascript:;" class="icon-remove"></a>
                                </span>
                            </div>
                            <div class="widget-body">
                                <div>
                                    <div class="clearfix">
                                        <div class="btn-group">
                                            <a  class="btn green" href="them-nhan-vien.htm">
                                                Thêm nhân viên mới <i class="icon-plus"></i>
                                            </a>
                                        </div>
                                        <div class="btn-group pull-right">
                                            <button class="btn dropdown-toggle" data-toggle="dropdown">Tools <i class="icon-angle-down"></i>
                                            </button>
                                            <ul class="dropdown-menu pull-right">
                                                <li><a href="#">Print</a></li>
                                                <li><a href="#">Save as PDF</a></li>
                                                <li><a href="#">Export to Excel</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="space15"></div>
                                    <table class="table table-striped table-hover table-bordered" id="editable-sample">
                                        <thead>
                                            <tr>
                                                <th style="width: 60px">Mã NV</th>
                                                <th style="width: 110px">Chức vụ</th>
                                                <th>Họ tên</th>
                                                <th>Địa chỉ</th>
                                                <th style="width: 80px">Ngày sinh</th>
                                                <th style="width: 90px">Điện thoại</th>
                                                <th style="width: 150px">Email</th>
                                                <th style="width: 90px">Giới tính</th>
                                                <th style="width: 40px">Sửa</th>
                                                <th style="width: 40px">Xóa</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <%

                                                for (Nhanvien nv : list)
                                                {
                                            %>
                                            <tr class="center">
                                                <td>
                                                    <h4><b><%=nv.getManv()%></b></h4>
                                                </td>
                                                <td><h4><b><%=nv.getLoainhanvien().getTenloai()%></b></h4></td>
                                                <td><h4><b><%=nv.getHoten()%></b></h4></td>
                                                <td><h4><b><%=nv.getDiachi()%></b></h4></td>
                                                <td><h4><b><%=CXuLy.ConvertDateToString(nv.getNgaysinh())%></b></h4></td>
                                                <td><h4><b><%=nv.getSodienthoai()%></b></h4></td>
                                                <td><h4><b><%=nv.getEmail()%></b></h4></td>
                                                <td><h4><b><%
                                                    String gioitinh = "Nữ";
                                                    if (nv.getGioitinh() == null)
                                                    {
                                                        gioitinh = "Nam";
                                                    }
                                                    out.println(gioitinh);
                                                            %></b></h4></td>
                                                <td><a href="update-nhan-vien.htm?id=<%=nv.getId()%>"><h4><b>Sửa</h4></b></a></td>
                                                <td><a onclick="return confirm('Bạn có chắc chắn xoá?');" href="delete-nhan-vien.htm?id=<%=nv.getId()%>"><h4><b>Xóa</h4></b></a></td>
                                            </tr>
                                            <%}%>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- END EXAMPLE TABLE widget-->
                    </div>
                </div>
                <%
                }
                else
                {
                %>
                <div class="row-fluid">
                    <div class="span12">
                        <!-- BEGIN EXAMPLE TABLE widget-->
                        <div class="widget purple">
                            <div class="widget-title">
                            </div>
                            <div class="widget-body">
                                <h1 style="color: red">The page you requested was not found.
                                </h1>
                            </div>
                        </div></div></div>
                        <%                            }
                        %>

            </div>
        </div>
        <!-------------------------------- ket thuc nội dung--------------------------------------->

    </div>

    <!--------------------------------footer--------------------------------------->
    <jsp:include page="User Control/footer.jsp" flush="true"></jsp:include>

    <!--------------------------------end footer--------------------------------------->

    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="js/jquery.blockui.js"></script>

    <script type="text/javascript" src="assets/bootstrap-toggle-buttons/static/js/jquery.toggle.buttons.js"></script>
    <script type="text/javascript" src="assets/chosen-bootstrap/chosen/chosen.jquery.min.js"></script>
    <script type="text/javascript" src="assets/uniform/jquery.uniform.min.js"></script>
    <script type="text/javascript" src="assets/bootstrap-wysihtml5/wysihtml5-0.3.0.js"></script>
    <script type="text/javascript" src="assets/bootstrap-wysihtml5/bootstrap-wysihtml5.js"></script>
    <script type="text/javascript" src="assets/clockface/js/clockface.js"></script>
    <script type="text/javascript" src="assets/jquery-tags-input/jquery.tagsinput.min.js"></script>
    <script type="text/javascript" src="assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="assets/bootstrap-daterangepicker/date.js"></script>
    <script type="text/javascript" src="assets/bootstrap-daterangepicker/daterangepicker.js"></script>
    <script type="text/javascript" src="assets/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
    <script type="text/javascript" src="assets/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>
    <script type="text/javascript" src="assets/bootstrap-inputmask/bootstrap-inputmask.min.js"></script>
    <script src="assets/fancybox/source/jquery.fancybox.pack.js"></script>

    <script type="text/javascript" src="assets/data-tables/jquery.dataTables.js"></script>
    <script type="text/javascript" src="assets/data-tables/DT_bootstrap.js"></script>





    <script src="js/common-scripts.js"></script>
    <script src="js/editable-table.js"></script>


    <script src="js/form-component.js"></script>
    <script>
                                                    jQuery(document).ready(function() {
                                                        EditableTable.init();
                                                    });
    </script>

</body>
</html>